import { Component } from '@angular/core';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  title = 'fatherSonProps';
  msg = '';

  show(msg:string){
    console.log(msg);
    // 这样即可把子组件传来的数据拿到并且赋值给自己了
    this.msg = msg;
  }
}
